package com.easy.order.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.concurrent.TimeUnit;

@Service
@FeignClient("easy-redis")
public interface RedisFeignService {
    @RequestMapping(value = "redis/setval",method = RequestMethod.POST)
    public void setVal(@RequestParam("key") String key,@RequestParam("val") String val);

    @RequestMapping(value = "redis/getval",method = RequestMethod.GET)
    public String getVal(@RequestParam("key")String key);
    @RequestMapping(value = "redis/deleteval",method = RequestMethod.DELETE)
    public Object deleteVal(@RequestParam("key") String key);
    @RequestMapping(value = "redis/setvalexpire",method = RequestMethod.POST)
    public void setValExpire(@RequestParam("key") String key,@RequestParam("val") String val,@RequestParam("time") int time,@RequestParam("unit") String unit);
}
